home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 127 / PC Guia 127.iso / Software / Produtividade / OpenOffice.org 2.0.1 / openofficeorg2.cab / index.html.xsl < prev    next >
Extensible Markup Language  |  2004-11-27  |  3KB  |  105 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <xsl:stylesheet version="1.0" 
  4.    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  5.     xmlns="http://www.w3.org/1999/xhtml">
  6.     
  7.     <xsl:output method               = "html"
  8.                 media-type           = "text/html"
  9.                 indent               = "yes"
  10.                 doctype-public       = "-//W3C//DTD HTML 4.0 Transitional//EN"
  11.                 omit-xml-declaration = "yes"
  12.                 standalone           = "yes" />
  13.    
  14.     <xsl:include href="../layout.xsl"/>
  15.        
  16.      
  17.      <!-- =============================
  18.                    HTML BODY
  19.      ================================== -->
  20.      
  21.      <xsl:template name="body">
  22.        <xsl:call-template name="title"/>
  23.          <xsl:call-template name="toc"/>
  24.      </xsl:template>
  25.      
  26.      
  27.      <xsl:template name="toc">
  28.         <!--
  29.              @ pre toc html here
  30.         -->
  31.         
  32.         <xsl:apply-templates select="/session/content/document"/>
  33.         
  34.         <!--
  35.              @ post toc html here
  36.         -->
  37.         
  38.      </xsl:template>
  39.      
  40.     <!-- also when using groups, in the end it comes 
  41.     to this template, which is called for each document -->
  42.     <xsl:template match="document">
  43.       <xsl:variable name="i" select="position() - 1"/>
  44.       <xsl:variable name="x" select="( $i mod 3 ) * 250 + 50"/>
  45.       <xsl:variable name="y" select="( $i mod 3 ) * 50 + (floor( $i div 3 )) * 300 + 80"/>
  46.       <div style="position:absolute; padding:15px; left:{$x}px; top:{$y}px; width:170px; height:220px; z-index:1" class="tcolor">
  47.           <div align="center">
  48.  
  49.             <xsl:apply-templates select="@icon"/>
  50.             <p>
  51.               <xsl:apply-templates select="@title"/>
  52.             <xsl:apply-templates select="@description"/>
  53.             <xsl:apply-templates select="@author"/>
  54.             <xsl:apply-templates select="@create-date"/>
  55.             <xsl:apply-templates select="@update-date"/>
  56.             <xsl:apply-templates select="@filename"/>
  57.             <xsl:apply-templates select="@format"/>
  58.             <xsl:apply-templates select="@pages"/>
  59.             <xsl:apply-templates select="@size"/>
  60.             </p>
  61.           </div>
  62.       </div>
  63.     </xsl:template>
  64.         
  65.  
  66.      
  67.      <xsl:template name="document-group">
  68.          <xsl:param name="group"/>
  69.          
  70.          <!-- @ pre group code here -->
  71.          
  72.          <!-- - - -->
  73.  
  74.              <xsl:variable name="count" select="(position() - 1) * $group + 1"/>
  75.              
  76.              <xsl:for-each select="/session/content/document[$count <= position() and position() < ($count + $group)]">
  77.              
  78.                 <xsl:apply-templates select="."/>
  79.                    
  80.              </xsl:for-each>
  81.          
  82.          <!-- @ post group code here -->
  83.          
  84.          <!-- - - -->
  85.          
  86.      </xsl:template>
  87.  
  88.           
  89.      <xsl:template name="title">
  90.         <!--
  91.           @ Pre title html code here
  92.         -->
  93.        <div style="position:absolute; left:280px; top:8px; width:220px; z-index:2; padding:10px" class="ccolor">
  94.           <div align="center" class="toctitle">
  95.               <xsl:value-of select="/session/general-info/@title"/>
  96.         <!--
  97.           @ Post title html code here
  98.         -->
  99.             </div>
  100.         </div>
  101.      </xsl:template>
  102.      
  103.          
  104. </xsl:stylesheet>
  105.